      SUBROUTINE SETUP
      RETURN
      END
C   HS57
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),FX,A(44),B(44),FIX
      INTEGER I
      SAVE A,B
      DATA A/2*8.D0,4*10.D0,4*12.D0,3*14.D0,3*16.D0,2*18.D0,3*20.D0,
     1       3*22.D0,3*24.D0,3*26.D0,2*28.D0,3*30.D0,2*32.D0,34.D0,
     2       2*36.D0,2*38.D0,40.D0,42.D0/
      DATA B/2*.49D0,.48D0,.47D0,.48D0,.47D0,2*.46D0,.45D0,.43D0,.45D0,
     1       2*.43D0,.44D0,2*.43D0,.46D0,.45D0,2*.42D0,.43D0,2*.41D0,
     2       .40D0,.42D0,2*.40D0,.41D0,.40D0,2*.41D0,3*.4D0,.38D0,
     3       .41D0,2*.4D0,.41D0,.38D0,2*.4D0,2*.39D0/
      ICF=ICF+1
      FX=0.D0
      DO      100      I=1,44
      FIX=B(I)-X(1)-(.49D0-X(1))*DEXP(-X(2)*(A(I)-8.D0))
      FX =FX+FIX**2
  100 CONTINUE
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      INTEGER J
      DOUBLE PRECISION X(NX),GRADF(NX),A(44),B(44),FIX,V,FI1,FI2
      SAVE A,B
      DATA A/2*8.D0,4*10.D0,4*12.D0,3*14.D0,3*16.D0,2*18.D0,3*20.D0,
     1       3*22.D0,3*24.D0,3*26.D0,2*28.D0,3*30.D0,2*32.D0,34.D0,
     2       2*36.D0,2*38.D0,40.D0,42.D0/
      DATA B/2*.49D0,.48D0,.47D0,.48D0,.47D0,2*.46D0,.45D0,.43D0,.45D0,
     1       2*.43D0,.44D0,2*.43D0,.46D0,.45D0,2*.42D0,.43D0,2*.41D0,
     2       .40D0,.42D0,2*.40D0,.41D0,.40D0,2*.41D0,3*.4D0,.38D0,
     3       .41D0,2*.4D0,.41D0,.38D0,2*.4D0,2*.39D0/
      ICGF=ICGF+1
      GRADF(1)= 0. D0
      GRADF(2)= 0. D0
      DO      100      J=1,44
      V=DEXP(-X(2)*(A(J)-8.D0))
      FIX=2.D0*(B(J)-X(1)-(.49D0-X(1))*V)
      FI1=-1.D0+V
      FI2=(.49D0-X(1))*V*(A(J)-8.D0)
      GRADF(1)=GRADF(1)+FI1*FIX
      GRADF(2)=GRADF(2)+FI2*FIX
  100 CONTINUE
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION  X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GXI
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      GOTO (100,200,300),I
  300 CONTINUE
      GXI=.49D0*X(2)-X(1)*X(2)-.09D0
      RETURN
  100 CONTINUE
      GXI=X(1)-.40D0
      RETURN
  200 CONTINUE
      GXI=X(2)+.5D0
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX) ,GRADGI(NX)
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
       DO     100      J=1,2
       GRADGI(J)=0.D0
  100  CONTINUE
       IF(I .EQ. 3)     GOTO 200
       GRADGI(I)=1.D0
       RETURN
  200  CONTINUE
       GRADGI(1)=-X(2)
       GRADGI(2)=.49D0-X(1)
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS57'/
      DATA X(1),X(2)/0.42D0,5.D0/
      DATA N/2/ , NH/0/ , NG/3/
      DATA DEL0/0.01D0/ ,TAU0/.1D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,3)/-1,0,0,1,1,1,1,2,1,-1,0,0/
      END
